package com.kun.entity;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson.annotation.JSONField;

@SuppressWarnings("serial")
public class BorrowRecord implements Serializable {
    private String borrowId;

    private String userId;

    private Integer bookId;

    private Integer amount;
    
    @JSONField(format="yyyy-MM-dd hh:mm:ss")
    private Date borrowTime;

    private String isDeal;//0未取  1已取  2已还

    private String isOvertime;

    private String bookSituation;

    private String result;
    
    @JSONField(format="yyyy-MM-dd hh:mm:ss")
    private Date returnTime;
    
    @JSONField(format="yyyy-MM-dd hh:mm:ss")
    private Date actualReturnTime;

    private User user;
    
    private Book book;
    
    //layui
    public String getNickName(){
    	if(user!=null){
    		return user.getNickname();
    	}else{
    		return null;
    	}
    }
    
    public String getRealName(){
    	if(user!=null){
    		return user.getRealname();
    	}else{
    		return null;
    	}
    }
    
    public String getBookName(){
    	if(book!=null){
    		return book.getBookname();
    	}else{
    		return null;
    	}
    }
    
    public String getBookNumber(){
    	if(book!=null){
    		return book.getBooknumber();
    	}else{
    		return null;
    	}
    }
    
    public String getBookType(){
    	if(book!=null&&book.getType()!=null){
    		return book.getType().getTypename();
    	}else{
    		return null;
    	}
    }
    
    public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Book getBook() {
		return book;
	}

	public void setBook(Book book) {
		this.book = book;
	}
    public String getBorrowId() {
        return borrowId;
    }

    public void setBorrowId(String borrowId) {
        this.borrowId = borrowId == null ? null : borrowId.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public Date getBorrowTime() {
        return borrowTime;
    }

    public void setBorrowTime(Date borrowTime) {
        this.borrowTime = borrowTime;
    }

    public String getIsDeal() {
        return isDeal;
    }

    public void setIsDeal(String isDeal) {
        this.isDeal = isDeal == null ? null : isDeal.trim();
    }

    public String getIsOvertime() {
        return isOvertime;
    }

    public void setIsOvertime(String isOvertime) {
        this.isOvertime = isOvertime == null ? null : isOvertime.trim();
    }

    public String getBookSituation() {
        return bookSituation;
    }

    public void setBookSituation(String bookSituation) {
        this.bookSituation = bookSituation == null ? null : bookSituation.trim();
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result == null ? null : result.trim();
    }

	public Date getReturnTime() {
		return returnTime;
	}

	public void setReturnTime(Date returnTime) {
		this.returnTime = returnTime;
	}

	public Date getActualReturnTime() {
		return actualReturnTime;
	}

	public void setActualReturnTime(Date actualReturnTime) {
		this.actualReturnTime = actualReturnTime;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}
    
    
}